package classwork320;

/**
 * @Author admin
 * @Date 2019/3/20 11:14
 */
public class CollegeStudent extends Student{
    public CollegeStudent() {
    }

    public CollegeStudent(String name) {
        super(name);
        this.type="专科生";
    }

    @Override
    public void calculateGrade() {
        double total=0;
        double average=0;
        for (int i = 0; i <courses.length ; i++) {
            total+=courses[i];

        }
        average=total/courseNO;
        if (average>=80&&average<=100){
            this.coursesGrade="优秀";
        }else if (average>=70){
            this.coursesGrade="良好";
        }else if (average>=60){
            this.coursesGrade="中等";
        } else if (average>=50){
            this.coursesGrade="及格";
        }else {
            this.coursesGrade="不及格";
        }
    }
}
